Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filterCollect to Record, Map and variants #1604

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qlonik
Copy link
Contributor

@qlonik qlonik commented Oct 20, 2021

There is filterMap as filtering extensions for map. This adds similar filtering variants for collect.

*/
export const filterCollect: <K>(
O: Ord<K>
) => <A, B>(f: (k: K, a: A) => Option<B>) => (m: Map<K, A>) => Array<B> = RM.filterCollect as any
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if doing as any is a good idea. But it avoids duplication implementing the same function with a different signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant